<template>
  <view>
    <view
      class="tui-actionsheet"
      :class="[show ? 'tui-actionsheet-show' : '']"
    >
	<view class="regional-selection">		
		<view class="flex justify-between align-center" style="background: #f5f5f5;">			
					
		</view>
		
		<view class="flex justify-between pt-30 mr-15" v-if="type==3" style="padding-top: 25rpx!important;">	
			<view class="lease_left flex">				
				<view class="flex lease_info">	
					<button open-type='contact' session-from='' class="btns" style="top: 18rpx;">
						<image src="../../static/resource/link.png" style="height: 44rpx; width: 44rpx;"></image>	
						<view class="flex" style="margin-top:-48rpx;">
							<text class="mt-5" style="margin-bottom: 80rpx; font-size: 26rpx;">联系客服</text>
						</view>
					</button>					  
				</view>
			</view>			
			<view class="flex justify-between" style="width: 574rpx;height: 88rpx; margin-bottom: 20rpx;">				
				<view class="submit-btn-left" style="background: #36B3E9 ;height: 88rpx !important;" v-if="!userInfo.token" @click="routeToLogin()">去下单</view>
				<view class="submit-btn-left" style="background: #36B3E9 ;height: 88rpx !important;" v-if="userInfo.token && userInfo.phone" @click="orderPay(goodsId,1)">去下单</view>		
			</view>					
		</view>		
		
		<view class="flex justify-between pt-30 mr-15" v-if="type==33">
			<view class="lease_left flex">				
				<view class="flex lease_info">	
					<button open-type='contact' session-from='' class="btns" style="top: 8rpx;">
						<image src="../../static/resource/link.png" style="height: 36rpx; width: 36rpx;"></image>	
						<view class="flex" style="margin-top:-48rpx;">
							<text class="mt-5" style="margin-bottom: 80rpx; font-size: 26rpx;">客服</text>
						</view>
					</button>	
				  
				</view>				
				<view class="flex lease_info" style="" @click="userInfo.token?docart():$routers.routeToLogin()">		
				   <image  src="../../static/resource/cars.png" style="height: 36rpx; width: 36rpx;"></image>
				   <text class="custom-btn-text" v-if="car_total>0">{{car_total}}</text>
				   <text class="mt-5" style="margin-bottom: 80rpx; font-size: 26rpx;">购物车</text>			
				</view>	 
			</view>			
			<view class="flex justify-between" style="width: 280px">				
				<view class="submit-btn-left"  v-if="!userInfo.token" @click="routeToLogin()">加入购物车</view>
				<view class="submit-btn-left"  v-if="userInfo.token && userInfo.phone" @click="order_car(goodsId,2)">加入购物车</view>										
				<view class="submit-btn-right" style="margin-top:0rpx" v-if="!userInfo.token" @click="routeToLogin()">立即购买</view>							
				<view class="submit-btn-right" style="margin-top:0rpx" v-if="userInfo.token && userInfo.phone" @click="order_car(goodsId,2)">立即购买</view>			
			</view>					
		</view>		
		
		<view class="flex justify-between pt-30 mr-15 align-center text-center" v-if="type==4">
			<view class="flex text-df ml-30" style="justify-content: flex-start;color: #000000;font-weight: 600;">
				
				<view class="flex align-center text-center mr-20"  @click="all_goods">					
					<radio color="#36B3E9" :checked='all_checked'></radio>	
					<text style="font-size: 32rpx;color: #222222;">全选</text>
				</view>	
				
				<view class="flex align-center text-center text-lg text-bold ml-20">
					<text style="font-size: 28rpx;color: #222222;">合计：</text>
					<text style="font-size: 28rpx;font-weight: bold;color: #FF2E00;margin-top: 5rpx;">¥ </text>
					<text style="font-size: 40rpx;font-weight: bold;color: #FF2E00; margin-left: 5rpx;">{{setting_money}}</text>
				</view>		
						 
						 
			</view>			
			<view class="flex justify-between">				
				<view class="submit-btn-right" style="background: #36B3E9 ;margin-top:0rpx"  @click="confirm_order(carIds)">去支付</view>
			</view>					
		</view>	
		
		<view class="flex justify-between pt-30 mr-15 align-center text-center" v-if="type==44">
			<view class="flex text-df ml-30" style="justify-content: flex-start;color: #000000;font-weight: 600;">
				<view class="flex align-center text-center mr-20"  @click="all_goods">					
					<radio color="#36B3E9" :checked='all_checked'></radio>	
					<text style="font-size: 32rpx;color: #222222;">全选</text>
				</view>				
				<view class="flex align-center text-center text-lg text-bold ml-20">
					<text style="font-size: 28rpx;color: #222222;">共计 </text>
					<text style="font-size: 28rpx;color: #36B3E9 ;" class="ml-5 mr-5" v-if="carIds">{{ carIds.split(",").length}}</text>
					<text style="font-size: 28rpx;color: #36B3E9 ;" class="ml-5 mr-5" v-if="!carIds">0</text>
					<text style="font-size: 28rpx;color: #222222;">件</text>
				</view>						 
			</view>			
			<view class="flex justify-between">				
				<view class="submit-btn-right" style="background: #36B3E9;margin-top:0rpx"  @click="del_carIds(carIds)">移除购物车</view>
			</view>					
		</view>	
		
		<view class="flex justify-between pt-30 mr-15 align-center text-center" v-if="type==5">
			<view class="flex flex-direction text-df ml-30" style="justify-content: flex-start;color: #000000;font-weight: 600;">
				<view class="flex align-center text-center text-lg text-bold">
					<text></text>
					<text class="text-red">¥ {{setting_money}}</text>
				</view>			     
			</view>			
			<view class="flex justify-between">				
				<view class="submit-btn-right" style="background: #36B3E9 ;margin-top:0rpx"  @click="order_pay_ok()">去支付</view>
			</view>					
		</view>	
		
		
		
		
		<view class="flex justify-between pt-30 mr-15" v-if="type==6">
			<view class="flex flex-direction text-df ml-30" style="justify-content: flex-start;">
				<view class="flex align-center text-center" style="font-size: 28rpx;">
					<view class=""  @click="radiochange_xy">
						<radio color="#FFA200" :checked='checked'></radio>	
					</view>					
					<text class="" style="color: rgba(1, 31, 55, 0.6);">已阅读并同意协议</text>
					<text class="" style="color: #FFA200;" @click="lease_xy">《租赁协议》</text>
				</view>
			     <view class="flex mt-20 align-center" style="color: rgba(1, 31, 55, 0.4);margin-left:30rpx">			     	
			     	<text class="text-lg" style="color: #011F37;">应付金额：</text>
					<text class="text-lg ml-5 text-bold" style="font-size: 32rpx;color: #FF2A00;"> ¥{{setting_money}}</text>
			     </view>   
			</view>			
			<view class="flex justify-between mt-10">				
				<view class="submit-btn-right" style="background: linear-gradient(-90deg, #FFA200 0%, #FFC13D 100%);margin-top:0rpx" @click="order_pay_ok()">提交订单</view>
			</view>					
		</view>	
				
		
		
		
		
		<view class="flex justify-between pt-30 mr-15 align-center text-center" v-if="type==8">
			<view class="flex flex-direction text-df ml-30" style="justify-content: flex-start;color: #000000;font-weight: 600;">
				<view class="flex align-center text-center text-lg">
					<text>积分：</text>
					<text class="text-red">	{{setting_money}}</text>
				</view>			     
			</view>			
			<view class="flex justify-between">				
				<view class="submit-btn-right" style="background: #518FA0;margin-top:0rpx"  @click="order_dochange()">立即兑换</view>
			</view>					
		</view>	
		
		<view class="flex justify-between pt-30 mr-15" v-if="type==8">					
			<view class="flex justify-between" style="width: 280px">				
				<view class="submit-btn-left" style="background: #518FA0;;" v-if="!userInfo.token" @click="routeToLogin()">立即兑换</view>
				<view class="submit-btn-left" style="background: #518FA0;;" v-if="userInfo.token && userInfo.phone" @click="order_change(goodsId)">立即兑换</view>		
			</view>					
		</view>		
		
		
		
		<view class="flex  pt-10 mr-15 justify-between  align-center text-center pb-10"  v-if="type==9">		
			<view class="flex flex-direction text-df ml-30 mt-15" style="justify-content: flex-start;color: #000000;font-weight: 600;">
				<view class="flex align-center text-center text-lg text-bold">
					<text>应付款：</text>
					<text class="text-red">¥ {{setting_money}}</text>
				</view>			     
			</view>						
			<view class="flex">				    
				<view class="mt-20 ml-20" v-if="goods_status==1">
				  <u-button text="取消订单" shape="circle" type="success" :plain="true" color="gray" size="small"  customStyle="width:150rpx;height:65rpx" @click="cancelorder()"></u-button>
				</view>					
				<view class="mt-20 ml-20" v-if="goods_status==1">
					<u-button text="去付款" shape="circle" type="success"   :plain="true" color="#36B3E9  " size="small" class="ml-20"  customStyle="width:150rpx;height:68rpx"@click="payorder()" ></u-button>
				</view>
			</view>					
		</view>	
		
		<view class="flex  pt-10 mr-15 justify-between  align-center text-center pb-10"  v-if="type==10">										
			<view class="flex">				    
				<view class="mt-10 ml-20" v-if="goods_status==3">
					<u-button text="确认收货" shape="circle" type="primary"  size="small" color="#36B3E9 ;" class="ml-20" customStyle="width:680rpx;height:88rpx;margin-left:20rpx "@click="payok()" ></u-button>
				</view>
			</view>					
		</view>	
		
		<view class="flex  pt-10 mr-15 justify-between  align-center text-center pb-10"  v-if="type==111">
			<view class="flex flex-direction text-df ml-30" style="justify-content: flex-start;">				
			     <view class="flex mt-20 align-center" style="color: rgba(1, 31, 55, 0.4);margin-left:30rpx">			     	
			     	<text class="text-bold" style="color: #FF2A00;font-size: 28rpx;">¥</text>
					<text class="ml-5 text-bold" style="font-size: 40rpx;color: #FF2A00;"> {{setting_money}}</text>
			     </view>   
			</view>			
			<view class="flex justify-between mt-10">	
				<u-button text="关联设备" shape="circle" type="success" :plain="true" color="#36B3E9" size="small"  customStyle="width: 214rpx;height: 88rpx;" @click="connect_device(orderId)"></u-button>
				<view class="submit-btn-right ml-15" style="background:#36B3E9;margin-top:0rpx;width: 214rpx;height: 88rpx;" @click="order_send(orderId)">确认配送</view>
			</view>					
		</view>	
		
		
		
		
		<view class="flex justify-between pt-30 mr-15 align-center text-center" v-if="type==66">
			<view class="flex flex-direction text-df ml-30" style="justify-content: flex-start;color: #000000;font-weight: 600;">
				<view class="flex align-center text-center text-lg text-bold">
					<text></text>
					
				</view>			     
			</view>			
			<view class="flex justify-between">				
				<view class="submit-btn-right" style="background: #36B3E9 ;margin-top:0rpx"  @click="order_please(orderId)">续租</view>
			</view>					
		</view>	
		
	</view>
    </view><strong></strong>
	
	
	
	<u-popup :show="please_show" @close="close">
		<view class="flex mt-30 mb-30 ml-20" style="position: relative;">
			<view class="flex" style="position: absolute;top: -10rpx; right: 20rpx;" @click="close">
				<u-icon name="close-circle" color="gray" size="28"></u-icon>
			</view>
			<view class=" border-radius" style="background: #fff;margin-top: 20rpx;width: 94%;">
			    <view class="order_main">
					<view class="address-title border-b">
						商品明细
					</view>   				
					<view class="flex pl-10 flex-direction" v-for="(item,index) in order_list.goods" :key="index">
						<view class="flex mt-10 mb-10">							
							<view slot='icon' class="flex align-center" >
								<image class="grid-img" :src="item.goods_logo" bindtap="handleChangeGoods" 	mode="scaleToFill"></image>
							</view>
							<view class="confirm-wrap-content flex flex-direction justify-between ml-10 mr-20 " slot='content' style="width: 98%;">
								<view>
								  <view class='flex align-center cell text-lg mb-10 mt-20'>{{item.goods_title}}</view>
								  <view class='flex align-center cell text-sm text-gray mt-15 justify-between'>
								     <text>{{item.goods_spec}}</text>
									
								  </view>
								   <view class='flex justify-between cell text-lg align-center text-center'>
									   <view class="flex text-bold">
											<text style="font-size: 28rpx;color: #FF2E00;margin-top: 10rpx;">￥</text>
											<text class="ml-5" style="font-weight: bold;font-size: 35rpx;color: #FF2E00;">{{item.selling_price}}/{{item.goods_days}}天</text>
									   </view>									  
								   </view>
								  
								   <view class='flex justify-between cell text-lg  align-center' >								 
										<text style="font-size: 28rpx;margin-top: 10rpx;"> 押金 </text>
										<text class="ml-5 text-bold" style="font-size: 28rpx;color: #FF2E00;margin-top: 10rpx;">￥{{order_list.order.deposit_price}}</text>																	   
								   </view>
								</view>
							</view>
							
					    </view>	
						<view class="flex text-center align-center border-t" style="justify-content: flex-end;">
							<text>数量</text>
							<t-input-number :value="number" :carId="goodsSpec.check_attr.id" @InputNumber="InputNumber"></t-input-number>
						</view>
						
						<view class="flex justify-between ml-15 mr-30 mb-15">
							<text>租赁天数</text>
							<text>{{goods_days}}天</text>
						</view>
						
			        </view>
			        <view class="flex justify-between align-center text-center  mt-20">
						<view class="flex align-center text-center ml-20">
							<text class="mr-20" style="color: #222222 ;">合计:</text>
							<view class="flex text-bold">
								<text style="font-size: 28rpx;color: #FF2E00;margin-top: 12rpx;">￥</text>
								<text class="ml-5" style="font-weight: bold;font-size: 40rpx;color: #FF2E00;">{{pay_price}}</text>
							</view>
						</view>
						<view class="submit-btn-lefts" style="background: #36B3E9;;"  @click="orderPlease()">续费</view>		
			        	
			        </view>
				</view>
			</view>
			
			
		</view>
	</u-popup>
	
	
	<!-- 属性信息 -->
	<biz-specs :show="specSelection"  ref="goodsSpec"  @chooseCancel="chooseCancel" @specsPay="specsPay"></biz-specs>	
  </view>
</template>
 
<script>
import goodsSpecs from "@/components/goods-specs/index.vue";
import input_number from "@/components/input-number/index.vue";
export default {
 components: {	
 	"biz-specs":goodsSpecs,
	 "t-input-number": input_number,
  },
  props: {
    //点击遮罩 是否可关闭
    maskClosable: {
      type: Boolean,
      default: true,
    },
    //显示操作菜单
    show: {
      type: Boolean,
      default: false,
    },
	orderId:{
		type:Number,
	},
	car_total:{
		type:Number,
	},
	type:{
		type:Number,
	},
	goodsId:{
		type:String,
	},		
	is_collect:{
		type: Boolean,
	},
	all_check:{
		type: Boolean,
	},
	date_count:{
		type:Number,
	},
	goods_status:{
		type:Number
	},
		
	logistics:{
		type:Number,
		 default: 0,
	},
		
	carIds:{
	  type:String,
	},
	setting_money:{
		type:String,
		default: "0.00",
	},
	one_selling_price:{
		type:String,
		default: "0.00",
	}
  },
  data(){
	  return {
		specSelection:false,
		userInfo:'',
		checked:false,
		all_checked:false,
		please_show:false,
		order_list:'',
		number:1,
		pay_price:0,
		deposit_price:0,
		selling_price:0,
		goods_days:1
	  }
  },
onShow(){
	this.all_checked=false
},
created() {
	if(uni.getStorageSync('userInfo')){
	   this.userInfo=uni.getStorageSync('userInfo')
	}
	this.all_checked=false
	console.log('userInfo',this.userInfo)
},
methods:  { 
	...getApp().globalData.function,	
	radiochange_xy(e){
		console.log(e)
		if(this.checked) this.checked=false;
		else   this.checked=true;
	},
	close() {
		this.please_show = false
		// console.log('close');
	},
	//修改数量
	InputNumber(e){
		if(e.type=='Minus'){
			if((this.number-1)<=0) this.number=1
			else this.number--
		}else{
			this.number++
		}
		let that= this	
		this.goods_days= that.order_list.goods[0].goods_days*this.number		
		let pay_price=that.order_list.goods[0].selling_price*this.number
		this.pay_price=pay_price.toFixed(2)
		
		
	},	
	order_send(orderId){
		let that=this
		uni.showModal({content: '确认配货完成嘛'}).then(res=>{			
		  if(res.confirm){
			this.$http.sendOrder({
				token:uni.getStorageSync('userInfo').token,
				orderId,
			}).then(res=>{
				if(res.resCode=='9999'){
				  uni.showToast({title:res.resMessage,icon:'none'})
				  setTimeout(()=>{
					 uni.navigateTo({
					 	url:"/pages/storage/home/index"
					 })
				  },2000)          
				  return
				}else{
				  uni.showToast(res.resMessage)
				}
			})       
		  }
		})
		
	},
	orderPlease(){
		let obj_data={
			token:uni.getStorageSync('userInfo').token,
			number:this.number,
			orderId:this.orderId
		}
		this.$http.payPlease(obj_data).then(rest=>{
			if(rest.resCode=='9999'){
				uni.requestPayment({
					provider: 'wxpay',
					timeStamp: rest.data.timeStamp,
					nonceStr: rest.data.nonceStr,
					package: rest.data.package,
					signType:rest.data.signType,
					paySign: rest.data.paySign,
					success: function (res) {											
						uni.switchTab({
							url:"/pages/order/index"
						})
					},
					fail: function (err) {
						uni.switchTab({
							url:"/pages/order/index"
						})
					},									
				});								   								   
			}else{
			   uni.showToast({title:res.resMessage,icon:"none"}) 
			}	
		})
		
		console.log('obj',obj)
	},
	//续租
	order_please(orderId){
		this.please_show=true
		console.log('orderId',orderId)
		 this.queryInfo()
	},
	//获取订单信息
	queryInfo(){
		let that=this
		let obj_data={
			token:uni.getStorageSync('userInfo').token,
			order_id:this.orderId
		}  
		this.$http.orderInfo(obj_data).then(res=>{
			if(res.resCode=="9999"){
			  that.order_list=res.data
			  that.selling_price=res.data.goods[0].selling_price
			  that.deposit_price=0
			  that.goods_days=res.data.goods[0].goods_days
			  let pay_price=res.data.goods[0].selling_price*1
			  that.pay_price=pay_price.toFixed(2)
			  
			  
			}else{
			  uni.showToast({title:res.resMessage,icon:"none"})
			}
		})  
	},	
	lease_xy(){
		this.$routers.router("/pages/pagesuser/agreement/index?type=4",'navigateTo')
	},
	//快递
	paykd(){
		this.$emit('confirm',{type:'kd'})
	},
	//购物车
	addcar(){
		this.$emit('confirm',{type:'car'})
	},
	//确认收货
	payok(){
		this.$emit('confirm',{type:'payok'})
	},
	//微信支付
	payorder(){
		this.$emit('confirm',{type:'pay'})
	},
	//取消订单
	cancelorder(){
		this.$emit('cancelorder')
	},
	//登录
	routeToLogin(){
		uni.navigateTo({
			url:"/pages/login/index"
		})
	},
	
	//全选
	all_goods(){
		this.all_checked=this.all_checked==true?false:true
		this.$emit('editCar',this.all_checked)
	},
	
    handleClickMask() {
		 this.$emit("chooseCancel",false);
    },
	//结算商品
	show_pay(){
		this.$emit('show_pay')
	},
	//去结算
	confirm(){
		this.$emit('confirm')
	},
	order_dochange(){
		this.$emit('confirm')
	},
	//确认订单
	confirm_order(carIds){
		// 去结算
		if(!carIds){
			uni.showToast({
			  title: '请选择商品信息！',
			  icon:"none",
			})
			return
		}		
		uni.setStorageSync('shop_type', 'carts');
		uni.navigateTo({
			url:"/pages/pagesOrder/confirm/index?carIds="+carIds
		})
		
	},
	//全选
	radioChange(all_check){
		console.log('all_check',all_check)
		if(all_check){
			this.$emit('update:all_check',false)
			this.$emit('allradio',false)
		} else{
			this.$emit('update:all_check',true)
			this.$emit('allradio',true)
		} 
		
	},
	
	//调整订单结算
	orderPay(goodsId){		
		let car={
			goodsId,
			number:1,
		}	
		console.log(uni.getStorageSync('userInfo').is_auth)
		if(uni.getStorageSync('userInfo').is_auth !=1){
			uni.showToast({title:'请先完成认证~',icon:'none'})
		   setTimeout(()=>{
				  this.$routers.router('/pages/pagesuser/auth/index','navigateTo') 	
				  return
		   },1000) 				
		}else{
			uni.navigateTo({
				url:"/pages/front/confirm/index?value="+JSON.stringify(car)
			})
		}
		
	},
	
	//获取属性
	order_car(goodsId,type){	
		let that=this
		if(uni.getStorageSync('userInfo').wx_openid){
			this.specSelection=true		
			   let obj={
				goodsId,
				token:uni.getStorageSync('userInfo').token
			   }
			    this.$http.goodsAttr(obj).then(res =>{
			      if(res.resCode=='9999'){							  
					that.$refs.goodsSpec.NgoodsSpec(res.data,type)
			      }else{
			        uni.showToast({
			          title: '系统繁忙，请稍后重试！',
			          icon:"none",
			        })
			    }
			})
		}else{
			uni.login({
				provider: 'weixin', //使用微信登录
				success(lres) {
					let code=lres.code						
					let obj={
						goodsId,
						code,
						token:uni.getStorageSync('userInfo').token
					}
					that.$http.goodsAttr(obj).then(res =>{
						  if(res.resCode=='9999'){		
							that.specSelection=true	
							that.$refs.goodsSpec.NgoodsSpec(res.data)
						  }else{
							uni.showToast({
							  title: '系统繁忙，请稍后重试！',
							  icon:"none",
							})
						}
					})
				}
			})
		}		
	},
	chooseCancel(){
		this.specSelection=false
	},
	specsPay(event){
		console.log('event----',event.car_total)
		this.car_total=event.goods_number
		this.$emit('editCar',{num:event.car_total})
	},
	//跳转商家
	router_shop(){
		getApp().storageId=uni.getStorageSync('shopInfo').storageId
		wx.switchTab({
		  url: '/pages/class/index' 
		})
	},
	order_pay(){		
		this.$emit('confirm')
	},
	//去支付
	order_pay_ok(){		
		this.$emit('confirm')		
	},
	docart(){
		uni.navigateTo({
			url:"/pages/pagesGoods/shopping-cart/index"
		})
	},
	//关联设备
	connect_device(orderId){
		uni.redirectTo({
			url:"/pages/storage/devices/connect?orderId="+this.orderId
		})
	},
	//立即兑换		
	order_change(goodsId){
		uni.navigateTo({
			url:"/pages/pagesuser/points/settlement?goodsId="+goodsId
		})
		// let that = this
		//  this.$http.DochangeGoods({
		// 	 goodsId,
		// 	 token:uni.getStorageSync('userInfo').token,
		//  }).then(res=>{
		// 	   if(res.resCode=='9999'){
		// 		   uni.showToast({title:'领取成功~',icon:'none'})
		// 		   setTimeout(()=>{
		// 		   		  that.$routers.router('/pages/pagesuser/points/log','navigateTo') 					  
		// 		   },2000) 				 
		// 	   }else that.$showToast(res.resMessage)
		//  })
	},
	//收藏商品
	collect_goods(goodsId){
		let that = this
		 this.$http.addgoodsCollect({
			 goodsId,
			 token:uni.getStorageSync('userInfo').app_openid,
			 login_type:'app',
		 }).then(res=>{
			  if(res.resCode=='9999'){
				that.$emit('update:is_collect',true)
			  }else{
				that.$emit('update:is_collect',false)
			  }
			 that.$showToast(res.resMessage)
		 })
	},
	
	del_carIds(carIds){
		if(!carIds){
			uni.showToast({
			  title: '请选择商品信息！',
			  icon:"none",
			})
			return
		}	
		let obj={
			carIds,
			token:uni.getStorageSync('userInfo').token
		   }
			this.$http.cardel(obj).then(res =>{
			  if(res.resCode=='9999'){							  
				uni.showToast({
				  title: '操作成功',
				  icon:"none",
				})
				this.$emit("delcars",false);
			  }else{
				uni.showToast({
				  title: '系统繁忙，请稍后重试！',
				  icon:"none",
				})
			}
		})
	},
	getPhoneNumberError(error){
		console.log('error',error)
	},
	//获取手机号
	getPhoneNumber(){
		console.log('ok---')
		let that =this
		my.getPhoneNumber({
		    success: (res) => {
				 console.log("手机信息-res",res);
		      let encryptedData = res.response;
		      console.log("手机信息",encryptedData);
			  this.$http.getPhone({
				  data:encryptedData,
				  token:uni.getStorageSync('userInfo').app_openid,
				  login_type:'app',
				  }).then(res=>{
				    if(res.resCode=='9999'){
				    	uni.setStorageSync('userInfo',res.data);	
						console.log('userInfo',uni.getStorageSync('userInfo'))
				        that.userInfo=res.data
				    }		
			  })
		     
		    },
		    fail: (res) => {
		      console.log(res);
		    },
		})
	}   
  },
};
</script>
 
<style scoped lang="less">
	
	.submit-btn-lefts {
	   display: flex;
	   align-items: center;
	   justify-content: center;
	   color: #fff;
	   min-width: 240rpx;
	   width: 60%;
	   height: 76rpx;
	   opacity: 1;
	   border-radius: 38rpx;
	   border-radius: 1998rpx 1998rpx 1998rpx 1998rpx;
	   border: 2rpx solid #DDDDDD;
	}
	
	
.btns{
	position: absolute;
	    top: 3px;
	    background: border-box;
}
.tui-actionsheet {
  width: 100%;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  visibility: hidden;
  transform: translate3d(0, 100%, 0);
  transform-origin: center;
  transition: all 0.3s ease-in-out;
  // background: #eaeaec;
  min-height: 75rpx;
  background-color: gray;
  
}
 
.tui-actionsheet-show {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}
.regional-selection {
	text-align: center;
	height: 160rpx;
	background: #FFFFFF;
}
.tui-actionsheet-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9996;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}
 
.tui-mask-show {
  opacity: 1;
  visibility: visible;
}
.submit-btn-right {
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  color: #FFF;
	  min-width: 240rpx;
	  width: 100%;
	  height: 76rpx;
	  opacity: 1;
	  border-radius: 38rpx;
	  margin-top: 2rpx;
	  
	}
</style>